
// 引入路由需要使用的页面组件
import Home from '../pages/Home';
// import Uc from './pages/Uc';
import List from '../pages/List';
// import Detail from './pages/Detail';
// import Sublist from './pages/Sublist';

import { useRouteError, useRoutes } from 'react-router-dom';


const BuildRoute = ()=>{

    // 好处在于在返回这个element之前可以根据不同的身份来返回不同的路由
    const adminElement = useRoutes([
        { path:'/' ,element: <Home /> },
        { path:'/list', element: <List /> }
      ]) 

      const guestElement = useRouteError([])



      return adminElement;
}

export default BuildRoute